CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(libmediaplayer)

FIND_PACKAGE	(PkgConfig		)
FIND_PACKAGE	(Threads		)
INCLUDE		(CMakeDependentOption	)

OPTION(ENABLE_AUDIO_ALSA	"Set this to enable the ALSA audio renderer"		ON)
OPTION(ENABLE_VIDEO_XV		"Set this to enable the XV video renderer"		ON)
OPTION(ENABLE_VIDEO_DIRECTFB	"Set this to enable the DirectFB video renderer"	ON)
OPTION(ENABLE_VIDEO_GTK		"Set this to enable the GTK+ video renderer (OpenGL)"	ON)

CMAKE_DEPENDENT_OPTION(ENABLE_SAMPLE_APP "Set this to enable the sample application" ON
	"ENABLE_VIDEO_GTK" ON
)

PKG_CHECK_MODULES(AVCODEC	REQUIRED	libavcodec	)
PKG_CHECK_MODULES(AVFORMAT	REQUIRED	libavformat	)
PKG_CHECK_MODULES(AVUTIL	REQUIRED	libavutil	)

IF(ENABLE_AUDIO_ALSA)
	PKG_CHECK_MODULES(ALSA REQUIRED alsa)
	ADD_DEFINITIONS(-DAUDIO_ALSA)
ENDIF(ENABLE_AUDIO_ALSA)

IF(ENABLE_VIDEO_DIRECTFB)
	PKG_CHECK_MODULES(DIRECTFB REQUIRED directfb)
	ADD_DEFINITIONS(-DVIDEO_DIRECTFB)
ENDIF(ENABLE_VIDEO_DIRECTFB)

IF(ENABLE_VIDEO_XV)
	PKG_CHECK_MODULES(X11 REQUIRED x11)
	PKG_CHECK_MODULES(XV REQUIRED xv)
	ADD_DEFINITIONS(-DVIDEO_XV)
ENDIF(ENABLE_VIDEO_XV)

IF(ENABLE_VIDEO_GTK)
	PKG_CHECK_MODULES(GTK REQUIRED gtk+-x11-2.0)
	PKG_CHECK_MODULES(GTKGL REQUIRED gtkglext-1.0)
	ADD_DEFINITIONS(-DVIDEO_GTK)
ENDIF(ENABLE_VIDEO_GTK)

SUBDIRS(src)

